<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>{$seo.title}</title>
    <meta name="Keywords" content="{$seo.keys}">
    <meta name="Description" content="{$seo.desc}">
    <link rel="stylesheet" href="__CSS__/amazeui.min.css"/>
    <link type="text/css" rel="stylesheet"  href="__CSS__/main.css"/>
    <link rel="stylesheet" href="__CSS__/mobile.css">
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script>
        var page = 1,flag  = true,params =  {page: page};
    </script>
</head>
<body>
{block name='header'}
<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav">
        <a href="javascript:history.back();" class="">
            <i class="am-header-icon am-icon-chevron-left"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        {present name='info'}{$info.title}{else /}{$title}{/present}
    </h1>
    <div class="am-header-right am-header-nav">
        <a href="{:url('Index/index')}" class="">
            <i class="am-header-icon am-icon-home"></i>
        </a>
    </div>
</header>
{/block}
{block name='content'}{/block}
<footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
    <div class="am-footer-switch">{php}$n=0;{/php}
        {volist name="menu" id='vo'}
        {if condition="$vo.pos eq 2"}{php}$n++;{/php}
        {notempty name='vo.alias'}{php}$url=url($vo['model'].'/detail',['cate'=>$vo['alias']]);{/php}{else /}{php}$url=url($vo['model'].'/index');{/php}{/notempty}
          {if condition='$n gt 1'}<span class="am-footer-divider"> | </span>{/if}<a class="am-footer-desktop" href="{$url}">{$vo.title}</a>
        {/if}
        {/volist}

    </div>
    <div class="am-footer-miscs ">

        <p>&copy;{:date('Y')}版权所有 {$site.title}</p>
        <p>客服电话：{$site.telphone}</p>
    </div>
    <div class="fang-footer-bar">
        <ul class="am-avg-sm-4">
            <li><a href="{:url('Index/index')}" {if condition='$controller eq "index"'}class="on"{/if}><i class="am-icon-home am-icon-sm"></i><p>首页</p></a></li>
            <li><a href="{:url('Loupan/index')}" {if condition='$controller eq "loupan"'}class="on"{/if}><i class="am-icon-building am-icon-sm"></i><p>新房</p></a></li>
            <li><a href="{:url('Second/index')}" {if condition='$controller eq "second"'}class="on"{/if}><i class="am-icon-institution am-icon-sm"></i><p>二手</p></a></li>
            <li><a href="{:url('user.index/index')}"><i class="am-icon-user am-icon-sm"></i><p>我的</p></a></li>
        </ul>
    </div>
</footer>
{$site.mobileJs}
{present name='ajaxdata'}
<div id="loadingToast" class="am-hide">
    <div class="ylj-mask"></div>
    <div class="ylj-toast">
        <i class="ylj-loading weui-icon_toast"></i>
        <p class="ylj-toast__content">数据加载中</p>
    </div>
</div>
<script src="__PUBLIC__/js/layer/laytpl.js"></script>
<script>
    $(function(){
        $(window).scroll(function(){
            if(($(window).scrollTop() + $(window).height() > $(document).height()-10) && flag){
                var totalpage = $("#lists").data('total');
                if(totalpage > 1 && totalpage >= page){
                    $("#loadingToast").removeClass('am-hide');
                    getData();
                }else{
                    $("#loading-alt").removeClass('am-hide');
                    flag = false;
                }
            }
        });
    });
    function getData(){
        var url =  $("#lists").data('uri');
        $.get(url,params,function(data){
            $("#loadingToast").addClass('am-hide');
            if(data.status == 1){
                if(data.data){
                    var gettpl = document.getElementById('template').innerHTML;
                    laytpl(gettpl).render(data.data, function(html){
                        $('#lists').append(html);
                    });
                }else{
                    $('#lists').html('<li>暂无数据</li>');
                }

            }else{
                $("#loading-alt").removeClass('am-hide');
                flag = false;
            }
        });
        page++;
    }
</script>
{/present}
</body>
</html>